import fetch from '@/config/fetch'
import {get, post} from '../config/https_method.js'


/**
 * 申请创建活动
 */
export const addActivity = query => post('/association/activity/addActivity', query);

/**
 * 社团名称
 */
export const getClublist = () => fetch('http://localhost:8080/association/club/getClubs', 'GET');


// /**
//  * 拒绝活动
//  */
// export const rejectActivity = data => fetch('http://localhost:8080/association/activity/rejectActivity', data);
//
// /**
//  * 同意活动
//  */
// export const agreesActivity = data => fetch('http://localhost:8080/association/activity/agreesActivity', data);
/**
 * 获取活动
 */
export const getPageActivity = query => get('/association/activity/getPageActivity', query);
/**
 * 审核活动
 */

/**
 * 审核活动
 * @param query
 * @returns {Promise | Promise<unknown>}
 */
export const auditActivity = query => post('/association/activity/auditActivity', query);
/**
 * 查看我的活动
 */
export const getMyActivityPageList = query => get('/association/joinActivity/getAllMyActivityByStatus', query);
/**
 * 查看可以加入的活动
 */
export const getCanJoinActivityPageList = query => get('/association/joinActivity/getAllCanJoinActivityByStatus', query);
/**
 * 申请加入活动
 */
export const joinActivity = query => get('/association/joinActivity/joinActivity', query);
/**
 * 活动管理
 */
export const getMyManageActivityPageList = query => get('/association/activity/getMyManageActivityPageList', query);
/**
 * 查看参加活动成员
 */
export const getActivityMember = query => get('/association/activity/getActivityMember', query);
/**
 * 查看参加活动成员人数
 */
export const getActivityMemberNum = query => get('/association/activity/getActivityMemberNum', query);
/**
 * 获取分页社团活动
 */
export const getClubActivity = query => get('/association/activity/getClubActivity', query);

/**
 * 获取社团活动
 */
export const getClubActivityList = query => get('/association/activity/getClubActivityList', query);
/**
 * 修改活动
 * @param query
 * @returns {Promise | Promise<unknown>}
 */
export const updateActivity = query => post('/association/activity/updateActivity', query);
